﻿using System;
using System.Collections.Generic;
using Infrastructure.Coding;
using Infrastructure.HardCoding;
using LinQProject.Repository;

namespace ServiceProject.EntityService
{
    //public class WeekHistoryService:DataBaseProcessBase<WeekHistory>
    //{
    //    public WeekHistoryService(FarmacieDataClassesDataContext database) : base(database){}

    //    public object AddWeekHistory(WeekHistory wHistory)
    //    {
    //        object returnValue=base.Add(wHistory, "WeekHistoryId");
    //        Setting settingToUpdate = new MaintananceBussiness(db).GetSetting((int) Enums.settings.productOfDayId);
    //        new SettingService(db).UpdateSetting(settingToUpdate);
    //        return returnValue;
    //    }

    //    public bool IsAlreadyEstablished(DateTime dt,out WeekHistory weekHistory)
    //    {
    //        int weekOfYear = TimeManagement.GetWeekOfTheYear(dt);
    //        IList<WeekHistory> lista = base.GetAll(wh => wh.WeekNo == weekOfYear);
    //        if (lista.Count > 0)
    //        {
    //            weekHistory = lista[0];
    //            return true;
    //        }
    //        weekHistory = null;
    //        return false;
    //    }
    //}
}
